<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Language" content="zh-CN"><link href="stylesheet.css" media="all" rel="stylesheet" type="text/css">
<title>扩展 SQL</title>
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head><body class="CHAPTER">
<div>
<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><th colspan="5" align="center" valign="bottom">PostgreSQL 8.2.3 中文文档</th></tr>
<tr><td width="10%" align="left" valign="top"><a href="server-programming.html" accesskey="P">后退</a></td><td width="10%" align="left" valign="top"><a href="server-programming.html#AEN36121">快退</a></td><td width="60%" align="center" valign="bottom"></td><td width="10%" align="right" valign="top"><a href="triggers.html">快进</a></td><td width="10%" align="right" valign="top"><a href="extend-how.html" accesskey="N">前进</a></td></tr>
</table>
<hr align="LEFT" width="100%"></div>
<div class="CHAPTER"><h1><a name="EXTEND"></a>章33. 扩展 SQL</h1>
<div>
<dl>
<dt><b>目录</b></dt>
<dt>33.1. <a href="extend-how.html">扩展性是如何实现的</a></dt>
<dt>33.2. <a href="extend-type-system.html">PostgreSQL 类型系统</a></dt>
<dd><dl>
<dt>33.2.1. <a href="extend-type-system.html#AEN36181">基本类型</a></dt>
<dt>33.2.2. <a href="extend-type-system.html#AEN36187">复合类型</a></dt>
<dt>33.2.3. <a href="extend-type-system.html#AEN36194">域</a></dt>
<dt>33.2.4. <a href="extend-type-system.html#AEN36200">伪类型</a></dt>
<dt>33.2.5. <a href="extend-type-system.html#EXTEND-TYPES-POLYMORPHIC">多态类型</a></dt>
</dl></dd>
<dt>33.3. <a href="xfunc.html">用户定义函数</a></dt>
<dt>33.4. <a href="xfunc-sql.html">查询语言(SQL)函数</a></dt>
<dd><dl>
<dt>33.4.1. <a href="xfunc-sql.html#XFUNC-SQL-BASE-FUNCTIONS">基本类型上的 SQL 函数</a></dt>
<dt>33.4.2. <a href="xfunc-sql.html#AEN36338">复合类型上的 SQL 函数</a></dt>
<dt>33.4.3. <a href="xfunc-sql.html#XFUNC-OUTPUT-PARAMETERS">带输出参数的函数</a></dt>
<dt>33.4.4. <a href="xfunc-sql.html#XFUNC-SQL-TABLE-FUNCTIONS">作为表数据源的 SQL 函数</a></dt>
<dt>33.4.5. <a href="xfunc-sql.html#AEN36424">返回集合的 SQL 函数</a></dt>
<dt>33.4.6. <a href="xfunc-sql.html#AEN36442">多态的 SQL 函数</a></dt>
</dl></dd>
<dt>33.5. <a href="xfunc-overload.html">函数重载</a></dt>
<dt>33.6. <a href="xfunc-volatility.html">函数易失性范畴</a></dt>
<dt>33.7. <a href="xfunc-pl.html">过程语言函数</a></dt>
<dt>33.8. <a href="xfunc-internal.html">内部函数</a></dt>
<dt>33.9. <a href="xfunc-c.html">C 语言函数</a></dt>
<dd><dl>
<dt>33.9.1. <a href="xfunc-c.html#XFUNC-C-DYNLOAD">动态加载</a></dt>
<dt>33.9.2. <a href="xfunc-c.html#XFUNC-C-BASETYPE">基本类型的 C 语言函数</a></dt>
<dt>33.9.3. <a href="xfunc-c.html#AEN36939">版本-0 调用约定</a></dt>
<dt>33.9.4. <a href="xfunc-c.html#AEN36966">版本-1 调用约定</a></dt>
<dt>33.9.5. <a href="xfunc-c.html#AEN37024">书写代码</a></dt>
<dt>33.9.6. <a href="xfunc-c.html#DFUNC">编译和链接动态加载的函数</a></dt>
<dt>33.9.7. <a href="xfunc-c.html#XFUNC-C-PGXS">扩展的编译架构</a></dt>
<dt>33.9.8. <a href="xfunc-c.html#AEN37384">复合类型参数</a></dt>
<dt>33.9.9. <a href="xfunc-c.html#AEN37408">返回行(复合类型)</a></dt>
<dt>33.9.10. <a href="xfunc-c.html#XFUNC-C-RETURN-SET">返回集合</a></dt>
<dt>33.9.11. <a href="xfunc-c.html#AEN37531">多态参数和返回类型</a></dt>
<dt>33.9.12. <a href="xfunc-c.html#AEN37552">共享内存和 LWLock</a></dt>
</dl></dd>
<dt>33.10. <a href="xaggr.html">用户定义聚集</a></dt>
<dt>33.11. <a href="xtypes.html">用户定义类型</a></dt>
<dt>33.12. <a href="xoper.html">用户定义操作符</a></dt>
<dt>33.13. <a href="xoper-optimization.html">操作符优化信息</a></dt>
<dd><dl>
<dt>33.13.1. <a href="xoper-optimization.html#AEN37716"><tt class="LITERAL">COMMUTATOR</tt></a></dt>
<dt>33.13.2. <a href="xoper-optimization.html#AEN37751"><tt class="LITERAL">NEGATOR</tt></a></dt>
<dt>33.13.3. <a href="xoper-optimization.html#AEN37767"><tt class="LITERAL">RESTRICT</tt></a></dt>
<dt>33.13.4. <a href="xoper-optimization.html#AEN37817"><tt class="LITERAL">JOIN</tt></a></dt>
<dt>33.13.5. <a href="xoper-optimization.html#AEN37849"><tt class="LITERAL">HASHES</tt></a></dt>
<dt>33.13.6. <a href="xoper-optimization.html#AEN37869"><tt class="LITERAL">MERGES</tt> (<tt class="LITERAL">SORT1</tt>, <tt class="LITERAL">SORT2</tt>, <tt class="LITERAL">LTCMP</tt>, <tt class="LITERAL">GTCMP</tt>)</a></dt>
</dl></dd>
<dt>33.14. <a href="xindex.html">扩展索引接口</a></dt>
<dd><dl>
<dt>33.14.1. <a href="xindex.html#XINDEX-IM">索引方法和操作符类</a></dt>
<dt>33.14.2. <a href="xindex.html#XINDEX-STRATEGIES">索引方法策略</a></dt>
<dt>33.14.3. <a href="xindex.html#XINDEX-SUPPORT">索引方法支持过程</a></dt>
<dt>33.14.4. <a href="xindex.html#XINDEX-EXAMPLE">例子</a></dt>
<dt>33.14.5. <a href="xindex.html#XINDEX-OPCLASS-CROSSTYPE">交叉数据类型的操作符类</a></dt>
<dt>33.14.6. <a href="xindex.html#XINDEX-OPCLASS-DEPENDENCIES">操作符类的系统相关性</a></dt>
<dt>33.14.7. <a href="xindex.html#XINDEX-OPCLASS-FEATURES">操作符类的特殊特性</a></dt>
</dl></dd>
</dl>
</div>
<a name="AEN36129"></a>
<p>在本章的剩余部分，我们将讨论你如何通过增加下面几种对象来扩展 PostgreSQL 的 SQL 查询语言：</p>
<ul compact="COMPACT">
<li style="list-style-type: disc"><p>函数(开始于<a href="xfunc.html">节33.3</a>)</p></li>
<li style="list-style-type: disc"><p>聚集(开始于<a href="xaggr.html">节33.10</a>)</p></li>
<li style="list-style-type: disc"><p>数据类型(开始于<a href="xtypes.html">节33.11</a>)</p></li>
<li style="list-style-type: disc"><p>操作符(开始于<a href="xoper.html">节33.12</a>)</p></li>
<li style="list-style-type: disc"><p>索引操作符类(开始于<a href="xindex.html">节33.14</a>)</p></li>
</ul>
</div>
<div>
<hr align="LEFT" width="100%">
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="33%" align="left" valign="top"><a href="server-programming.html" accesskey="P">后退</a></td><td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">首页</a></td><td width="33%" align="right" valign="top"><a href="extend-how.html" accesskey="N">前进</a></td></tr>
<tr><td width="33%" align="left" valign="top">服务器端编程</td><td width="34%" align="center" valign="top"><a href="server-programming.html" accesskey="U">上一级</a></td><td width="33%" align="right" valign="top">扩展性是如何实现的</td></tr>
</table>
</div>
</body></html>